//
//  RDReader.h
//  readApp
//
//  Created by 飞猪 on 2018/8/16.
//  Copyright © 2018年 😝😝😝😝😝. All rights reserved.
//

#import "RDRootController.h"
@class RDReader;
@class RDChapterModel;

typedef NS_ENUM(NSUInteger, RDReaderState) {
  RDReaderStateBusy,
  RDReaderStateReady
};

@protocol RDReaderDelegate <NSObject>

- (void)readerSettingClicked:(RDReader *)reader chapterModel:(RDChapterModel *)chapterModel;
- (void)reader:(RDReader *)reader state:(RDReaderState)state;
- (void)reader:(RDReader *)reader curChapter:(NSString *)curChapter curPage: (NSInteger)curPage totalPages:(NSInteger)totalPages curPageContent:(NSString *)content;
- (void)reader:(RDReader *)reader chapterTitle:(NSString *)chapterTitle;
- (void)reader:(RDReader *)reader chapter:(RDChapterModel *)chapter;

@optional
- (void)reader:(RDReader *)reader updateModel:(RDChapterModel *)chapter;

@end

@interface RDReader : RDRootController

@property (nonatomic, weak  ) id<RDReaderDelegate> delegate;

/// 配置类
@property (nonatomic, strong) RDConfiguration *config;

- (void)readWithFilePath:(NSString *)filePath pageIndex:(NSInteger)pageIndex;

- (void)readWithParam:(NSDictionary *)params;

- (void)beginWithParam:(NSDictionary *)params;

//- (void)readChapterAtChapterIndex:(NSString *)chapterId pageIndex:(NSInteger)pageIndex;
- (void)readChapterAtChapterIndex:(RDChapterModel *)chapterModel pageIndex:(NSInteger)pageIndex;

@end
